#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>


int main(int argc,char* argv[])
{

  for(int i = 0;argv[i];i++ )
  {
    printf("&argv[%d]:%p\n",i,argv+i);
  }

  printf("--------------------------\n");

  for(int i = 0;argv[i];i++ )
  {
    printf("&argv[%d]:%s\n",i,argv+i);
  }

  printf("--------------------------\n");
  for(int i = 0;argv[i];i++ )
  {
    printf("argv[%d]:%s\n",i,argv[i]);
  }

  printf("--------------------------\n");
  for(int i = 0;argv[i];i++ )
  {
    printf("argv[%d]:%p\n",i,argv[i]);//数组首元素地址就是数组的地址
  }


  printf("--------------------------\n");
  for(int i = 0;argv[i];i++ )
  {
    printf("argv[%d]:%p\n",i,&argv[i]);//数组首元素地址就是数组的地址
  }
  return 0;
}


//int main()
//{
//
//const char* myenv1 = getenv("hello");
//const char* myenv2 = getenv("gm");
//
//if(myenv1 == NULL)
//{
//  printf("none\n");
//}
//else{
//  printf("myenv1:%s\n",myenv1);
//}
//
//if(myenv2 == NULL)
//{
//  printf("none \n");
//}
//else{
//  printf("myenv2:%s\n",myenv2);
//}
//
////
////  extern char** environ;
////  for(int i = 0;environ[i];i++)
////  {
////    printf("environ[%d],%s\n",i,environ[i]);
////  }
//
//
//  return 0;
//}
